home *** CD-ROM | disk | FTP | other *** search
/ Cracking 2 / Cracking II..iso / Texty / crackme / Visual Basic 5.txt < prev    next >
Encoding:
Text File  |  1998-11-16  |  3.0 KB  |  67 lines

  1. Visual Basic 5 Cracking Tutorial
  2. --------------------------------
  3. by The Krazy Nomad [MEX/C4N'98]
  4. krazy@scenelink.org
  5.  
  6.  
  7. Hello there! Im glad you decided to take a look at this tutorial. You may
  8. have been wondering what the hell is the deal with a VB program? Why is this
  9. subject so controversial? The truth is, as you might have heard, that Visual
  10. Basic executables are not REAL EXE files. In fact, they rely on a DLL in
  11. order to function correctly. This is where we can take advange on such a
  12. protection. At its heart! I have coded a small Crack-Me in Visual Basic 5
  13. with a simple protection. This will be our target.
  14.  
  15. Tools Used:
  16. W32dasm v8.9
  17. SoftICE v3.22
  18.  
  19.  
  20. Ok, lets first take a look at the program in w32dasm, so open up the crack-me
  21. and wait till its finished disassembling. First thing to do it look at the
  22. Imported Funtions so we can see what we will be dealing with in SoftICE.
  23. Ahhh, as we said, everything will be interacting with MSVBVM50.DLL. So before
  24. we go any further, lets add msvbvm50.dll to our winice.dat if you have not
  25. done so already (if you do not know how to do this, refer to ED!SON's
  26. wonderful cracking tutorial) and reboot. Now lets get back to the imported
  27. functions.
  28.  
  29.  
  30. Hmm, __vbaR8Str looks very intresting, lets see is anything happens if we
  31. set a breakpoint on this. So, lets enter a bogus registration number in the
  32. dialog box the go to SoftICE, set the "bpx __vbaR8Str", then go back to the
  33. app and click ok. Now we should be in SoftICE. Press F11 to go to the calling
  34. function. We should be at the following code:
  35.  
  36.  
  37. 00402163 FF75E0            push [ebp-20]       ; push entered serial on
  38.                                                ; stack as string
  39.  
  40. * Reference To: MSVBVM50.__vbaR8Str, Ord:0000h ; convert string to a real or
  41.                                                ; floating point number...
  42.  
  43. 00402166 E885EFFFFF        Call 004010F0       ; after this call ST(0) should
  44.                                                ; contain the entered serial
  45.                                                ; as number
  46.  
  47. 0040216B DC1D28104000      fcomp qword ptr [00401028] ; float compare : ST(0)
  48.                                                       ; =? X - and X is
  49.                                                       ; located at 401028
  50.  
  51. 00402171 DFE0              fstsw ax            ; ? set flag;
  52.  
  53. 00402173 9E                sahf                ; ? test flag
  54.  
  55. 00402174 7503              jne 00402179        ; good/bad jump
  56.  
  57.  
  58. Ok, we see the address where its comparing the serial at, lets take a look
  59. and see whats behind the curtain. In SoftICE, we type in "dl 401028" and what
  60. do you know, the serial is sitting right there for you. Clear your
  61. breakpoints and go back to the crack-me and enter the serial and it will now
  62. give you the "Thank you for Registering" Dialog. Nice work!
  63.  
  64. I hope you learned something about how *some* Visual Basic programmers go
  65. about protecting thier apps. If you did learn something, email me and let me
  66. know. It would make me glad. :)
  67.